﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ebMS3dotnet.Core
{
    internal class ebMS3Context
    {

        public UserMessageInfo UserMessage { get; set; }

       
    }
    public class UserMessageInfo
    {
        private MessageInfo _messageInfo = new MessageInfo();
        private PartyInfo _partyInfo = new PartyInfo();
        private CollaborationInfo _collaborationInfo = new CollaborationInfo();

        public string Mpc { get; set; }

        internal MessageInfo MessageInfo
        {
            get { return _messageInfo; }
            set { _messageInfo = value; }
        }

        public PartyInfo PartyInfo
        {
            get { return _partyInfo; }
            set { _partyInfo = value; }
        }
        public CollaborationInfo CollaborationInfo
        {
            get { return _collaborationInfo; }
            set { _collaborationInfo = value; }
        }


    }

    public class MessageInfo
    {
        public DateTime Timestamp { get; set; }
        public string MessageID { get; set; }
        public string RefToMessageId { get; set; }
    }

    public class PartyInfo
    {
        private List<Party> _from = new List<Party>();
        private Party _to = new Party();

        /// <summary>
        /// This property is always initialised.
        /// </summary>
        public List<Party> From
        {
            get { return _from; }
        }

        /// <summary>
        /// To is always initialised by PartyInfo
        /// </summary>
        public Party To
        {
            get { return _to; }
        }
    }

    public class Party
    {
        public string PartyId { get; set; }
        public string Role { get; set; }
        public string Type { get; set; }
    }

    public class CollaborationInfo
    {
        private Service _service = new Service();
        private AgreementRef _agreementRef = new AgreementRef();
        public AgreementRef AgreementRef { get { return _agreementRef; } }

        /// <summary>
        /// This required element is always initialised.
        /// </summary>
        public Service Service { get { return _service; } }

        public string Action { get; set; }

        public string ConversationID { get; set; }
    }

    public class AgreementRef
    {
        public string Value { get; set; }

        public string Type { get; set; }

        public string PMode { get; set; }
    }

    public class Service
    {
        public string Value { get; set; }

        public string Type { get; set; }
    }
}
